
const bulletSpeed = 7
const topLine = -100
const bottomLine = 1130

const isOverLine = (val) => {
    if (val <= topLine) {
        return true
    }
    if (val >= bottomLine) {
        return true
    }
    return false
}

export const moveBullets = (bullets) => {
    bullets.forEach((bullet, index) => {
        bullet.y += bulletSpeed*bullet.dir
        if (isOverLine(bullet.y)) {
            bullets.splice(index, 1)
        }
    });
}